package kr.co.mustgo.model.service.reservation;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import kr.co.mustgo.domain.reservation.Reservation;
import kr.co.mustgo.model.dao.reservation.ReservationDAO;

@Service
public class ReservationServiceImpl implements ReservationService {
	@Autowired
	private ReservationDAO dao;

	@Override
	public Reservation searchProductInfo(Reservation reservation)
			throws SQLException {
		return dao.selectProductInfo(reservation);
	}

	@Override
	public Reservation searchReserveInfo(Reservation reservation)
			throws SQLException {
		return dao.selectReserveInfo(reservation);
	}

	@Override
	public int registerReserverInfo(Reservation reservation)
			throws SQLException {
		return dao.insertReserverInfo(reservation);
	}

	@Override
	public List<Reservation> searchReservation(Reservation reservation)
			throws SQLException {
		return dao.selectReservation(reservation);
	}

	@Override
	public int modifyReservation(Reservation reservation) throws SQLException {
		// TODO Auto-generated method stub
		return dao.updateReservation(reservation);
	}

	@Override
	public int removeReservation(Reservation reservation) throws SQLException {
		// TODO Auto-generated method stub
		return dao.deleteReservation(reservation);
	}
	
	private String makeSqlReserveCode(String reserveCode){
		return "예약 Service"+reserveCode;
	}
}
